home *** CD-ROM | disk | FTP | other *** search
/ Star Trek Starfleet Academy Mini Omnipedia / MINI_OMNI.ISO / pc / omni_v2.dxr / 00406_printing handlers.ls < prev    next >
Encoding:
Text File  |  1996-04-15  |  1.5 KB  |  47 lines

  1. on hTestPrintObjs
  2.   set tmpPrinter to birth(script "class EntryPrinter")
  3.   if objectp(tmpPrinter) = 0 then
  4.     put ">hTestPrintObjs temp object = 0"
  5.   end if
  6.   put "tmpPrinter=" & tmpPrinter
  7. end
  8.  
  9. on hPrintEntry
  10.   global gPrintSearchtext, gComputerTypeK, gModeState, gInputField, gdescfield, gCurrEntryAttrib
  11.   set vSource to #paramount
  12.   if gModeState = #Resources then
  13.     hReportStatus("Sorry, Resources cannot be printed.")
  14.     hearit(gNopeSND)
  15.     exit
  16.   end if
  17.   if gModeState = #TOPICS then
  18.     if not (line 1 of field gdescfield starts "‚Ä¢") then
  19.       hReportStatus("Sorry, Topics cannot be printed.")
  20.       hearit(gNopeSND)
  21.       exit
  22.     else
  23.       set vSource to #user
  24.     end if
  25.   end if
  26.   set tmpPrinter to birth(script "class EntryPrinter", vSource)
  27.   if objectp(tmpPrinter) = 0 then
  28.     if gComputerTypeK = #mac then
  29.       alert("Sorry, can't open the printing feature. Check that you have selected a printer in the Chooser.")
  30.     else
  31.       alert("Sorry, can't open the printing feature. Check that you have selected a printer in the Print Manager.")
  32.     end if
  33.     return 
  34.   end if
  35.   set vEntry to hGetText(getAt(gCurrEntryAttrib, 9), getAt(gCurrEntryAttrib, 10))
  36.   set oldDelim to the itemDelimiter
  37.   set the itemDelimiter to "@"
  38.   set vStyles to item 1 of vEntry
  39.   set vHeading to item 2 of vEntry
  40.   delete char 1 of vHeading
  41.   delete item 1 of vEntry
  42.   delete item 1 of vEntry
  43.   delete char 1 of vEntry
  44.   mRender(tmpPrinter, vHeading, vStyles, vEntry)
  45.   set the itemDelimiter to oldDelim
  46. end
  47.